package com.lyncs.ods.modules.company.service;

import com.lyncs.ods.modules.company.model.CompanyUserRole;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lyncs.ods.resp.UserGroupInfo;

import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 企业用户权限信息 服务类
 * </p>
 *
 * @author alex
 * @since 2022-07-11
 */
public interface CompanyUserRoleService extends IService<CompanyUserRole> {

    List<Long> getUserGroupRoleIds(@NotNull Long companyId, @NotNull Long userId);

    Map<Long, List<Long>> getUserGroupRoleIds(@NotNull Long companyId, @NotNull List<Long> userIds);

    Map<Long, List<UserGroupInfo>> getUserGroupInfos(@NotNull Long companyId, @NotNull List<Long> userIds);

    /**
     * 获取用户权限组内可见的企业ID
     *
     * @param userId    用户ID
     * @param companyId 企业ID
     * @return ids
     */
    List<Long> listAllAvailablePartnerId(Long userId, Long companyId);
}
